function multiply(array)
{
    // write code here
    let pre = []
    let next = []
    let res = []
    let n = array.length - 1
    for(let i = 0;i <= n;i++){
      if(i === 0){
        pre[i] = 1
      }else{
        pre[i] = pre[i-1] * array[i-1]
      }
    }
    for(let i = n;i >= 0;i--){
      if(i === n){
        next[i] = 1
      }else{
        next[i] = next[i+1] * array[i+1]
      }
    }
    for(let i = 0;i <= n;i++){
      res[i] = pre[i] * next[i]
    }
    return res
}
module.exports = {
    multiply : multiply
};